package com.prik.decorator;

import com.prik.decorator.coffee.Americano;
import com.prik.decorator.coffee.Beverage;
import com.prik.decorator.condiment.Hazelnut;
import com.prik.decorator.condiment.Vanilla;

/**
 * @description: test
 * @author: prik
 * @create: 2019-07-24
 **/
public class Test {

    public static void main(String[] args) {

        // Beverage beverage = new Latte();
        // System.out.println(beverage.getDescription() + " ￥" + beverage.cost());
        //
        // Beverage beverage2 = new Latte();
        // // 加香草
        // beverage2 = new Vanilla(beverage2);
        // System.out.println(beverage2.getDescription() + " ￥" + beverage2.cost());
        //
        // Beverage beverage3 = new Americano();
        // // 加香草
        // beverage3 = new Vanilla(beverage3);
        // // 加榛子
        // beverage3 = new Hazelnut(beverage3);
        // System.out.println(beverage3.getDescription() + " ￥" + beverage3.cost());


        Beverage beverage = new Americano();
        System.out.println(beverage.getDescription() + " ￥" + beverage.cost());

        Beverage beverage2 = new Americano();
        // 加香草
        beverage2 = new Vanilla(beverage2);
        // 加榛子
        beverage2 = new Hazelnut(beverage2);
        System.out.println(beverage2.getDescription() + " ￥" + beverage2.cost());



    }
}